import Vue from "vue"
import Vuex from "vuex"

//仿数据库数据
const userList = require("../../public/data/userList.json");
const fastReply = require("../../public/data/fastReply.json");
const productList = require("../../public/data/product.json");
const messageList = require("../../public/data/messageList.json")
const robotReply = require("../../public/data/robotReply.json")
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 全局的用户对象
    user: {
      uid: '',
      uname: "",
      phone: "",
    },
    arr: [],

    //chat
    userList: userList,
    fastReply: fastReply,
    productList: productList,
    messageList: messageList,
    robotReply: robotReply
  },
  mutations: {
    //获取用户信息
    getUserInfo(state, data) {
      state.user = data
    },
  },
  actions: {},
  modules: {},
})
